package com.example.keymanagers.keyAdapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.example.keymanagers.R;
import com.example.keymanagers.bean.Bean;

import java.util.List;

public class adapter extends BaseAdapter {
    List<Bean> list;
    private vih vh;

    public adapter(List<Bean> list) {
        this.list=list;



    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        vih vh;
        vh =new vih();

        view=LayoutInflater.from(viewGroup.getContext())
                .inflate(R.layout.listview,viewGroup,false);
        vh.tv1=view.findViewById(R.id.tv1);
        vh.tv2=view.findViewById(R.id.tv2);
        vh.tv3=view.findViewById(R.id.tv3);

        view.setTag(vh);
         vh.be=list.get(i);

        vh.tv1.setText(vh.be.getAddress());
        vh.tv2.setText(vh.be.getRoom());
        vh.tv3.setText(vh.be.getDate());



        return view;
    }
    class vih{
        TextView tv1,tv2,tv3;
        Bean be;



    }

}
